home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.lib;
-
-
- import java.awt.Point;
- import java.awt.Dimension;
- import java.awt.Rectangle;
-
- /**
- * This class provides a container object that does the extra damage
- * declarations for semantic_lens children. Basically any damage that
- * is inside the bound one of its children that is a semantic_lens object is
- * expanded to include all of that lens object. This is needed since drawing
- * inside lenses is not limited to the bounds of the object that controls the
- * drawing (but is limited to the lens).
- *
- * @see semantic_lens
- * @author Scott Hudson
- */
- public class semantic_lens_parent extends base_parent_interactor
- {
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Full constructor.
- *
- * @param int x x position of the object
- * @param int y y position of the object
- * @param int w width of the object
- * @param int h height of the object
- */
- public semantic_lens_parent(int x, int y, int w, int h)
- {
- super(x,y,w,h);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Catch damage from children and expand it to include damage from
- * each of our lenses that overlap the damage. We need to do this
- * because drawing in a lens is not limited to the bound of the object
- * that created it (but is limited to the lens).
- *
- * @param Point top_left top-left corner of damage from one of our
- * children (in our coordinates).
- * @param Dimension sz the size of the damage rectangle.
- */
- public void damage_from_child(Point top_left, Dimension sz)
- {
- Rectangle damage;
-
- /* let the super class do child damage itself */
- super.damage_self(top_left, sz);
-
- /* look through the children and do damage for any lenses we find
- * that overlap the damage from the child.
- */
- damage = new Rectangle(top_left, sz);
- for (int i = 0; i < num_children(); i++)
- {
- if ((child(i) instanceof semantic_lens) &&
- child(i).bound().intersects(damage))
- damage_self(child(i).pos(), child(i).size());
- }
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-